This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
fix: [devworkpsce-handler] Move project section from editor devfile to user devfile #1271
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…o user devfile Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
Codecov Report
@@ Coverage Diff @@
## main #1271 +/- ##
==========================================
+ Coverage 32.78% 35.81% +3.02%
==========================================
Files 290 324 +34
Lines 9885 10480 +595
Branches 1457 1356 -101
==========================================
+ Hits 3241 3753 +512
- Misses 6641 6723 +82
- Partials 3 4 +1
Continue to review full report at Codecov.
|
svor
approved these changes
Dec 9, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Generated DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
name: theia-ide-spring-petclinic
spec:
commands:
- id: init-container-command
apply:
component: remote-runtime-injector
events:
preStart:
- init-container-command
components:
- name: theia-ide
container:
image: quay.io/eclipse/che-theia:next
env:
- name: THEIA_PLUGINS
value: local-dir:///plugins
- name: HOSTED_PLUGIN_HOSTNAME
value: 0.0.0.0
- name: HOSTED_PLUGIN_PORT
value: '3130'
- name: THEIA_HOST
value: 127.0.0.1
volumeMounts:
- name: plugins
path: /plugins
- name: theia-local
path: /home/theia/.theia
mountSources: true
memoryLimit: 512M
cpuLimit: 1500m
cpuRequest: 100m
endpoints:
- name: theia
attributes:
type: main
cookiesAuthEnabled: true
discoverable: false
urlRewriteSupported: true
targetPort: 3100
exposure: public
secure: false
protocol: https
- name: webviews
attributes:
type: webview
cookiesAuthEnabled: true
discoverable: false
unique: true
urlRewriteSupported: true
targetPort: 3100
exposure: public
secure: false
protocol: https
- name: mini-browser
attributes:
type: mini-browser
cookiesAuthEnabled: true
discoverable: false
unique: true
urlRewriteSupported: true
targetPort: 3100
exposure: public
secure: false
protocol: https
- name: theia-dev
attributes:
type: ide-dev
discoverable: false
urlRewriteSupported: true
targetPort: 3130
exposure: public
protocol: http
- name: theia-redirect-1
attributes:
discoverable: false
urlRewriteSupported: true
targetPort: 13131
exposure: public
protocol: http
- name: theia-redirect-2
attributes:
discoverable: false
urlRewriteSupported: true
targetPort: 13132
exposure: public
protocol: http
- name: theia-redirect-3
attributes:
discoverable: false
urlRewriteSupported: true
targetPort: 13133
exposure: public
protocol: http
- name: terminal
attributes:
type: collocated-terminal
discoverable: false
cookiesAuthEnabled: true
urlRewriteSupported: true
targetPort: 3333
exposure: public
secure: false
protocol: wss
attributes:
app.kubernetes.io/component: che-theia
app.kubernetes.io/part-of: che-theia.eclipse.org
- name: plugins
volume: {}
- name: theia-local
volume: {}
- name: che-machine-exec
container:
image: quay.io/eclipse/che-machine-exec:next
command:
- /go/bin/che-machine-exec
- '--url'
- 127.0.0.1:3333
- '--idle-timeout'
- 15m
memoryLimit: 128Mi
memoryRequest: 32Mi
cpuLimit: 500m
cpuRequest: 30m
attributes:
app.kubernetes.io/component: machine-exec
app.kubernetes.io/part-of: che-theia.eclipse.org
- name: remote-runtime-injector
container:
image: quay.io/eclipse/che-theia-endpoint-runtime-binary:next
env:
- name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
value: /remote-endpoint/plugin-remote-endpoint
- name: REMOTE_ENDPOINT_VOLUME_NAME
value: remote-endpoint
volumeMounts:
- name: plugins
path: /plugins
- name: remote-endpoint
path: /remote-endpoint
memoryLimit: 128Mi
memoryRequest: 32Mi
cpuLimit: 500m
cpuRequest: 30m
attributes:
app.kubernetes.io/component: remote-runtime-injector
app.kubernetes.io/part-of: che-theia.eclipse.org
- name: remote-endpoint
volume:
ephemeral: true
---
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
name: spring-petclinic
spec:
started: true
template:
attributes:
che-theia.eclipse.org/sidecar-policy: USE_DEV_CONTAINER
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-d433ed6
memoryLimit: 3Gi
endpoints:
- exposure: none
name: debug
protocol: tcp
targetPort: 5005
- exposure: public
name: 8080-tcp
protocol: http
targetPort: 8080
volumeMounts:
- name: m2
path: /home/user/.m2
- path: /remote-endpoint
name: remote-endpoint
- path: /plugins
name: plugins
env:
- name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
value: /remote-endpoint/plugin-remote-endpoint
- name: THEIA_PLUGINS
value: local-dir:///plugins/sidecars/tools
args:
- sh
- '-c'
- ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
attributes:
che-theia.eclipse.org/vscode-extensions:
- >-
https://download.jboss.org/jbosstools/static/jdt.ls/stable/java-0.75.0-60.vsix
- >-
https://download.jboss.org/jbosstools/vscode/3rdparty/vscode-java-debug/vscode-java-debug-0.26.0.vsix
- >-
https://open-vsx.org/api/vscjava/vscode-java-test/0.28.1/file/vscjava.vscode-java-test-0.28.1.vsix
che-theia.eclipse.org/vscode-preferences:
java.server.launchMode: Standard
app.kubernetes.io/name: tools
- name: m2
volume:
size: 1G
- name: mysql
container:
image: >-
quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764
memoryLimit: 300Mi
endpoints:
- exposure: none
name: db
protocol: tcp
targetPort: 3306
env:
- name: MYSQL_USER
value: petclinic
- name: MYSQL_PASSWORD
value: petclinic
- name: MYSQL_DATABASE
value: petclinic
- name: PS1
value: $(echo ${0})\\$
- name: theia-ide-spring-petclinic
plugin:
kubernetes:
name: theia-ide-spring-petclinic
commands:
- id: prepare-database
exec:
component: mysql
workingDir: ${PROJECTS_ROOT}/java-spring-petclinic
commandLine: >
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root <
${PROJECTS_ROOT}/java-spring-petclinic/src/main/resources/db/mysql/user.sql
&& \
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root petclinic <
${PROJECTS_ROOT}/java-spring-petclinic/src/main/resources/db/mysql/schema.sql
&& \
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root petclinic <
${PROJECTS_ROOT}/java-spring-petclinic/src/main/resources/db/mysql/data.sql
&& \
echo -e "\e[32mDone.\e[0m Database petclinic was configured"
group:
kind: run
isDefault: true
- id: build
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/java-spring-petclinic
commandLine: mvn clean install
group:
kind: build
isDefault: true
- id: run-with-hsqldb
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/java-spring-petclinic
commandLine: java -jar target/*.jar
group:
kind: run
isDefault: true
- id: run-with-mysql
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/java-spring-petclinic
commandLine: >
java -jar -Dspring-boot.run.profiles=mysql \
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
target/*.jar
group:
kind: run
isDefault: true
- id: run-debug
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/java-spring-petclinic
commandLine: >-
java -jar -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
target/*.jar
group:
kind: run
isDefault: true
projects:
- name: java-spring-petclinic
git:
remotes:
origin: https://github.com/che-samples/java-spring-petclinic.git
checkoutFrom:
revision: devfilev2
❌ E2E Happy path tests failed ❗ See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
benoitf
approved these changes
Dec 9, 2021
happy path is working in github actions |
9 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Igor Vinokur ivinokur@redhat.com
What does this PR do?
Move the generated
projects
section from the editor devfile to the user devfile.Screenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#20877
How to test this PR?
devworkspace-handler
packagenode lib/entrypoint.js --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/devfilev2 --output-file:/Users/ivinokur/projects/che-theia/tools/devworkspace-handler/a.yaml
in the package root and see the default projects section exists in the user devfile of thegenerated template.node lib/entrypoint.js --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/devfilev2 --output-file:/Users/ivinokur/projects/che-theia/tools/devworkspace-handler/a.yaml --project.name={{DEVFILE_REGISTRY_URL}}/project.zip
and see the projects section with the specified projects in the zip format exists in the user devfile of thegenerated template.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.
Happy Path Channel
HAPPY_PATH_CHANNEL=stable